import { ApiProperty } from '@nestjs/swagger'
import { Type } from 'class-transformer'
import { IsArray, IsNumber } from 'class-validator'

export class UpdateSortItemDto {
  @ApiProperty({ description: '应用ID' })
  @IsNumber()
  id: number

  @ApiProperty({ description: '排序值' })
  @IsNumber()
  sort: number
}

export class UpdateSortDto {
  @ApiProperty({ description: '排序列表', type: [UpdateSortItemDto] })
  @IsArray()
  @Type(() => UpdateSortItemDto)
  sortList: UpdateSortItemDto[]
}
